
##------------------------------------------------------------------
##
##  This makefile will build C XCMDs for HyperTalk
##
##  Copyright Apple Computer, Inc.  1991
##  All Rights Reserved.
##

##  Builds:  CBeep

##  This makefile depends on a .r file called CBeep.r to act
##  as a source for the resource compiler.

TargetXCMD	= CBeep

TargetObjs	= CBeep.c.obj


#------------------------------------------------------------------
#
#  default options for the language processors.
#

AOptions	=	
POptions	=	-r -saddr
COptions	=
LOptions	=	-x
ROptions	=	-i "{MPW}Interfaces:RIIGSIncludes"

#------------------------------------------------------------------
#
#  default build rules.  Invokes language processors for source files.
#

.a.obj  .a
	asmiigs {aoptions} {default}.a -o {default}.a.obj

.p.obj  .p
	pascaliigs {poptions} {default}.p -o {default}.p.obj

.c.obj  .c
	ciigs {coptions} {default}.c -o {default}.c.obj


#------------------------------------------------------------------
#
#  The compilers will output 3 or more segments:  main, containing code;
#  and ~globals and ~arrays containing data.  This line ensures that
#  everything gets put back into the main segment.
#
#  In addition, it specifically links the EntryPoint procedure FIRST,
#  ahead of any globals or data structures.
#

SegsToMain	=	-lseg main					
			{TargetXCMD}.c.obj(@EntrySeg)			
			{TargetXCMD}.c.obj(@Main)			
			{TargetXCMD}.c.obj(@~arrays)			
			{TargetXCMD}.c.obj(@~globals)			
			"{CIIGSLibraries}"CLib


#------------------------------------------------------------------
#
#  main build rules
#

{TargetXCmd}		{TargetXCmd}.omf	{TargetXCmd}.r
	reziigs {TargetXCmd}.r {ROptions} -o {TargetXCmd}.rsrc
	duplicateiigs -r -y -m {targetXCmd}.rsrc {TargetXCmd}

{TargetXCmd}.omf		{TargetObjs}
	flush
	linkiigs {TargetObjs}			
		 {LOptions}			
		 {SegsToMain}			
		 -lib "{CIIGSLibraries}"CLib	
		 -o {TargetXCmd}.omf

